<% provide(:title, '考试管理') %>
<div class="row">
  <div class="col-lg-12">
    <h1 class="page-header">考试后台管理</h1>
  </div>
</div>
<div class="row">
  <div class="col-lg-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <%= link_to '新建考试', new_admin_exam_path, class: ' btn btn-success' %>
      </div>
      <!-- /.panel-heading -->
      <div class="panel-body">
        <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
          <thead>
          <tr>
            <th>考试标题</th>
            <th>简介</th>
            <th>发起时间</th>
            <th>参与人数</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
          <% @exams.each do |exam| %>
              <tr>
                <td class="center"><%= exam.title.capitalize %></td>
                <td class="center"><%= exam.description.capitalize %></td>
                <td class="center"><%= exam.created_at.strftime("%Y-%m-%d %H:%M:%S") %></td>
                <td class="center"><%= exam.respondents.count %></td>
                <td>
                  <%= link_to '编辑考试', edit_admin_exam_path(exam) %>
                  <%= link_to "查看答卷", admin_exam_path(exam) %>
                  <%= link_to "导出成绩", edit_admin_exam_path(exam) %>
                  <%= link_to "添加问题", admin_choices_path(:exam_id => exam.id) %>
               </td>
              </tr>
          <% end %>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>




